
<form method="post" action="/oss/?r=packetNum/doAdd">
    <{include file='../common_params.tpl'}>

    <div class="box box-black">
        <div class="box-body">
            <table class="table table-bordered">
                <colgroup>
                    <col style="width: 20%;"></col>
                    <col style="width: 80%;"></col>
                </colgroup>

                <tr>
                    <th class="th-label">渠道</th>
                    <td>
                        <select class="form-control inline" style="width: 160px;" name="channel_id">
                        <option value ="">请选择</option> 
                        <{foreach from=$channelList item=item key=key}>                           
                        <option value ="<{$key}>"><{$item}></option>                  
                        <{/foreach}>
                        </select>                       
                    </td>
                </tr>
                
                <tr>
                    <th class="th-label">编号</th>
                    <td>
                        <input type="text" name="number" class="form-control inline" placeholder="" />
                    </td>
                </tr>
                

            </table>
        </div>

        <div class="box-footer">
            <a href="javascript:history.go(-1);" class="btn btn-default">返回</a>
            <button type="submit" id="sub" class="btn btn-default pull-right">保存</button>
        </div>
    </div>
</form>


<script>
    $(function(){
    	$("#sub").click(function(){
    		$channel_id = $('select[name="channel_id"]').val();
    		$number = $('input[name="number"]').val();
            if($channel_id == ''){
            	layer.alert('请选择渠道', {icon: 2, skin: 'layui-layer-molv'});
                return false;
            }
            if($number == ''){
            	layer.alert('请填写编号', {icon: 2, skin: 'layui-layer-molv'});
                return false;
            } 
       });       
    });
</script>